package com.york.subject.application.interceptor;

import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * openFeign的配置类
 * 这里加入了我们自定义的拦截器FeignRequestInterceptor
 * 作用是为了让RPC调用时也能拿到user的loginId，也就是username
 */
@Configuration
public class FeignConfiguration {

    @Bean
    public RequestInterceptor requestInterceptor(){
        return new FeignRequestInterceptor();
    }

}
